<?php
class EWebby_Data_MySql_MysqlReader implements EWebby_Data_IDbReader {
	private $_row;
	private $_conn;
	private $_result;
	
	public function __construct($conn, $result) {
		$this->_conn 	= $conn;
		$this->_result 	= $result;
	}
	
	public function read() {
		return ($this->row = @mysql_fetch_array ( $this->_result, MYSQL_ASSOC ));
	}
	
	public function getCurrentItem() {
		return $this->row;
	}
	
	public function close($closeConnection = true) {
		@mysql_free_result ( $this->_result );
		if( $closeConnection ) {
			@mysql_close ( $this->_conn );
		}
	}
}